@use '../shared/styles/details-base';
@use '../shared/styles/utils';

@include utils.dark-theme {
	--gl-color-background-counter: #fff;
}

@include utils.light-theme {
	--gl-color-background-counter: #000;
}

.commit-detail-panel {
	height: 100vh;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	overflow: auto;
}

main {
	flex: 1 1 auto;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

[hidden] {
	display: none !important;
}

gl-commit-details,
gl-wip-details {
	display: contents;
}

webview-pane-group {
	height: 100%;
	overflow: hidden;
}

.popover-content {
	background-color: var(--color-background--level-15);
	padding: 0.8rem 1.2rem;
}

.inspect-header {
	display: flex;
	flex-direction: row;
	align-items: flex-start; // center;
	justify-content: space-between;
	gap: 0.4rem;
	border-top: 2px solid var(--color-background--level-15);

	&__tabs {
		flex: none;
		display: flex;
		flex-direction: row;
		// gap: -0.8rem;
		align-items: flex-start;
	}

	&__tab {
		position: relative;
		appearance: none;
		background-color: var(--color-background--level-10);
		color: var(--color-foreground--85);
		border: none;
		border-radius: 0 0 0.5rem 0.5rem;
		padding: 0.4rem 1.2rem;
		cursor: pointer;

		&:last-child {
			margin-inline-start: -0.6rem;
		}

		&.is-active {
			z-index: 1;
			background-color: color-mix(in srgb, var(--gl-color-background-counter) 25%, var(--color-background));
			padding-block: 0.6rem;
			box-shadow: 0 -2px 0 0 var(--vscode-button-hoverBackground);
			color: var(--color-foreground);
		}

		&-tracking {
			--gl-pill-foreground: currentColor;
			--gl-pill-border: color-mix(in srgb, transparent 80%, var(--color-foreground));
			margin-inline: 0.2rem -0.4rem;
		}

		&-indicator {
			--gl-indicator-size: 0.46rem;
			position: absolute;
			bottom: 0.825rem;
			left: 2.1rem;
			z-index: 1;

			&--ahead {
				--gl-indicator-color: var(--vscode-gitlens-decorations\.branchAheadForegroundColor);
			}
			&--behind {
				--gl-indicator-color: var(--vscode-gitlens-decorations\.branchBehindForegroundColor);
			}
			&--both {
				--gl-indicator-color: var(--vscode-gitlens-decorations\.branchDivergedForegroundColor);
			}
		}

		&.is-active &-indicator {
			bottom: 1.025rem;
		}

		&-pulse {
			position: absolute;
			bottom: 0.2rem;
			right: 0.4rem;
			z-index: 2;
		}
	}

	&__content {
		flex: 1;
		min-width: 0;
		margin: {
			top: 0.3rem;
			right: 0.3rem;
		}
	}
}

.section--message {
	> :first-child:not(:last-child) {
		margin-bottom: 0.4rem;
	}
}

.issue > :not(:first-child) {
	margin-top: 0.5rem;
}

:root {
	--gk-avatar-size: 1.6rem;
}

hr {
	border: none;
	border-top: 1px solid var(--color-foreground--25);
}

.md-code {
	background: var(--vscode-textCodeBlock-background);
	border-radius: 3px;
	padding: 0px 4px 2px 4px;
	font-family: var(--vscode-editor-font-family);
}

.inline-popover {
	display: inline-block;
}

.tooltip-hint {
	white-space: nowrap;
	border-bottom: 1px dashed currentColor;
}
